package com.huawo.qjs;

public class QjsResource {
    private String id;
    private int color;
    private String key;

    public QjsResource(String id, int color) {
        this.id = id;
        this.color = color;
        if (id.endsWith("_g")) {
            String tmp = id.replace("_g", "");
            String prefix = tmp.substring(0, tmp.lastIndexOf("_"));
            String suffix = tmp.substring(tmp.lastIndexOf("_"), tmp.length());
            this.key = prefix + "_" + color + suffix;
        } else {
            this.key = id + "_" + color;
        }
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public int getColor() {
        return color;
    }

    public void setColor(int color) {
        this.color = color;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }
}
